const Toast = (message,callback,delay)=>{
	if(!delay)delay=3000
	uni.showToast({
		title:message,
		icon:'none',
		duration:delay,
		success(){
			callback && (setTimeout(()=>{
				callback();
			},delay));
		}
	})
}
//显示成功
const Success = (message,callback,delay)=>{
	if(!delay)delay=3000
	uni.showToast({
		title:message,
		icon:"success",
		duration:delay,
		success(){
			callback && (setTimeout(()=>{
				callback();
			},delay));
		}
	})
}
//显示失败
const Fail=(message,callback)=>{
	uni.showModal({
		//title:"提示",
		content:message,		
		showCancel:false,
		duration:3000,
		success(res){
			callback && callback(res);
		}
	})
}
//显示选择
const Confirm=(msg,cancelText,confirmText,callback)=>{
	uni.showModal({		
		content:msg,
		showCancel:true,
		cancelText:cancelText,
		confirmText:confirmText,
		success(res){
			callback && callback(res);
		}
	})
}

const Info = (ref,message,callback)=>{
	ref.msg = message;
	ref.maskShow = true;	
	ref.type = 'toast'	
}

module.exports = {    
	Success,
	Fail,
	Confirm,
	Toast,
	Info
}